package jp.sourceforge.akjrcp.audiotools;

import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.commons.ui.widget.WidgetBuilder;
import jp.sourceforge.akjrcp.ui.LabelTextLabel;
import jp.sourceforge.akjrcp.ui.LayoutDataBuilder;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

/*
 * still development?
 */
public class PitchAnalyzeSettingDialog extends MessageDialog{
		private LabelTextLabel ditailData;
		private LabelTextLabel minData;
		private LabelTextLabel maxData;

		private int detail;
		private int min;
		private int max;
		public PitchAnalyzeSettingDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
			super(parentShell, dialogTitle, dialogTitleImage, "",
					dialogImageType, dialogButtonLabels, defaultIndex);

		}
		
		  protected Control createCustomArea(Composite root) {
			  root.setLayout(new GridLayout(1,false));
		        
			    ditailData=new LabelTextLabel(root,SWT.NULL,Messages.getString("waveformview.detail"),""+detail,"",false);
			    ditailData.getMainText().addModifyListener(new ModifyListener(){
					public void modifyText(ModifyEvent e) {
						detail=Integer.parseInt(ditailData.getText());
						
					}});
			    ditailData.setLayoutData(LayoutDataBuilder.hintGridData(150, 0), LayoutDataBuilder.hintGridData(100, 0), null);
			    ditailData.getMainText().setOrientation(SWT.RIGHT_TO_LEFT);
			    
			    minData=new LabelTextLabel(root,SWT.NULL,Messages.getString("waveformview.min"),""+min,"khz",false);
			    minData.getMainText().setOrientation(SWT.RIGHT_TO_LEFT);
			    minData.getMainText().addModifyListener(new ModifyListener(){
					public void modifyText(ModifyEvent e) {
						min=Integer.parseInt(minData.getText());
						
					}});
			    
			    minData.setLayoutData(LayoutDataBuilder.hintGridData(150, 0), LayoutDataBuilder.hintGridData(100, 0), null);
			    
			    maxData=new LabelTextLabel(root,SWT.NULL,Messages.getString("waveformview.max"),""+max,"khz",false);
			    maxData.getMainText().setOrientation(SWT.RIGHT_TO_LEFT);
			    maxData.getMainText().addModifyListener(new ModifyListener(){
					public void modifyText(ModifyEvent e) {
						max=Integer.parseInt(maxData.getText());
						
					}});
			    maxData.setLayoutData(LayoutDataBuilder.hintGridData(150, 0), LayoutDataBuilder.hintGridData(100, 0), null);
			    

		        return root;
		    }

		public LabelTextLabel getMinData() {
			return minData;
		}

		public void setMinData(LabelTextLabel minData) {
			this.minData = minData;
		}

		public int getDetail() {
			return detail;
		}

		public void setDetail(int detail) {
			this.detail = detail;
		}

		public int getMin() {
			return min;
		}

		public void setMin(int min) {
			this.min = min;
		}

		public int getMax() {
			return max;
		}

		public void setMax(int max) {
			this.max = max;
		}


	

	}
